<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table border="1" style="margin-left: 30%">
  <tr>
    <td>订单ID</td>
    <td>用户名</td>
    <td>商品名</td>
    <td>数量</td>
    <td>价格</td>
    <td>订单状态</td>
    <td>交易时间</td>
  </tr>
  <tr th:each="order:${page.getRecords()}">
    <td th:text="${order.getOrderId()}"/>
    <td th:text="${order.getUsers().getUsername()}" />
    <td th:text="${order.getGoods().getGoodsName()}"/>
    <td th:text="${order.getOrderGoodsNumber()}"/>
    <td th:text="${order.getOrderPrice()}"/>
    <td th:switch="${order.getOrderState()}">
      <a href="#" th:case="1">去支付</a>
      <span th:case="2">待发货
      </span>
      <span th:case="3">
      <a th:href="@{/buyer/modifyState(orderId=${order.getOrderId()},state=${4})}">确认收货</a>
      </span>
      <span th:case="4">订单完成/
        <a th:href="@{/buyer/modifyState(orderId=${order.getOrderId()},state=${5})}" >申请退款</a>/
        <a th:href="@{/buyer/modifyState(orderId=${order.getOrderId()},state=${0})}">删除订单</a>
      </span>
      <span th:case="5">退款中</span>
      <span th:case="6">已退款/
      <a th:href="@{/buyer/modifyState(orderId=${order.getOrderId()},state=${0})}">删除</a>
      </span>
      <span th:case="7">订单完成/
       <a th:href="@{/buyer/modifyState(orderId=${order.getOrderId()},state=${5})}" >申请退款</a>/
        <a th:href="@{/buyer/modifyState(orderId=${order.getOrderId()},state=${0})}">删除订单</a>
      </span>
      <span th:case="8">拒绝退款/
       <a href="" >申诉</a>/
        <a th:href="@{/buyer/modifyState(orderId=${order.getOrderId()},state=${0})}">删除订单</a>
      </span>
    </td>
    <td th:text="${order.getOrderCreateTime()}"/>
  </tr>
</table>
</body>
</html>